import java.util.*;

    class Student implements Comparable<Student> {
    int age;
    public Student(int a) {
        this.age=a;
    }

        @Override
        public int compareTo(Student o) {
            return this.age-o.age;
        }
    }

public class demo1 {
    public static void main(String[] args) {
        Map<Student,Integer> map = new TreeMap<>();
        map.put(new Student(8),6);
        map.put(new Student(2),5);

    }
    public static void main1(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        map.put("RZ",2);
        map.put("FW",10);
        map.put("NT",20);
        Set<Map.Entry<String,Integer>> s = map.entrySet();
       for(Map.Entry<String,Integer> entry : s) {
           System.out.println(entry.getKey()+"  "+entry.getValue());
       }
    }
}
